﻿<navigation:Page x:Class="RegOnline.UchebnPlanPage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
               xmlns:Converters="clr-namespace:RegOnline"
           xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"      
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"  d:DesignWidth="800" d:DesignHeight="600"
           Title="UchebnPlanPage" Style="{StaticResource PageStyle}" DataContext="{Binding}" NavigationCacheMode="Enabled" Loaded="Page_Loaded">


    <UserControl.Resources>
        <Converters:DeleteButtonVisibiliryConverter x:Key="delButtonVisibiliryConverter"/>
        <Converters:LoadButtonVisibiliryConverter x:Key="loadButtonVisibiliryConverter"/>

    </UserControl.Resources>

    <Grid   x:Name="InterfeceStudgGrid2" Style="{StaticResource LayoutRootPageGridStyle}" Margin="0,0,80,80">
		<Grid.RowDefinitions>
			<RowDefinition Height="80" />
			<RowDefinition Height="60" />
			<RowDefinition Height="1*" />
			<RowDefinition Height="33" />
		</Grid.RowDefinitions>
		<Grid  Margin="20,20,20,0" x:Name="grid6" VerticalAlignment="Top" >
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="100" />
				<ColumnDefinition Width="127*" />
				<ColumnDefinition Width="100" />
				<ColumnDefinition Width="212*" />
				<ColumnDefinition Width="67" />
				<ColumnDefinition Width="74*" />
			</Grid.ColumnDefinitions>
			<Grid.RowDefinitions>
				<RowDefinition Height="30" />
				<RowDefinition Height="30" />
			</Grid.RowDefinitions>
			<sdk:Label Content="Вид работы:" Grid.Column="0" Grid.Row="0"  Margin="3"  FontSize="12" />
			<sdk:Label Height="28" Grid.Column="1" Grid.Row="0" Margin="3" x:Name="vidLabel" PropertyPath="Vid" Target="{Binding}"  FontSize="12" />
			<sdk:Label Content="Дисциплина:" Grid.Column="2" Grid.Row="0"  Margin="3" FontSize="12" />
			<sdk:Label Grid.Column="3"  Margin="3,3,6,3" x:Name="disLabel" PropertyPath="Dis" Target="{Binding}" FontSize="12" />

			<sdk:Label Content="Семестр: " Grid.Column="4" Margin="0,3" FontSize="12" HorizontalContentAlignment="Right" />
			<sdk:Label Grid.Column="5"  Margin="0,3,3,3" x:Name="semNumLabel" Content="{Binding SemNum}"  FontSize="12" />

			<sdk:Label Content="Группа:" Grid.Column="0" Grid.Row="1"  Margin="3" FontSize="12" />
			<sdk:Label Grid.Column="1" Grid.Row="1"  Margin="3" x:Name="grupNameLabel" Content="{Binding grupName}" FontSize="12" />
        </Grid>

		<Grid   x:Name="themeGrid" Style="{StaticResource LayoutRootPageGridStyle}" Margin="0" Grid.Column="0" Grid.Row="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="*" />
				<RowDefinition Height="*" />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="89" />
				<ColumnDefinition Width="439*" />
				<ColumnDefinition Width="69" />
				<ColumnDefinition Width="123*" />
			</Grid.ColumnDefinitions>
             
			<sdk:Label Content="Тема работы:" Margin="3,3,0,3"  FontSize="12"  />
			<TextBox  Grid.Column="1" Margin="0,4" x:Name="themeBox" Text="{Binding}"  FontSize="12" TextChanged="themeBox_TextChanged" />
            
            
			<sdk:Label Content="Вариант:" Grid.Column="1" Margin="434,3,0,3" FontSize="12" HorizontalContentAlignment="Right" Grid.ColumnSpan="2" />
			<TextBox Grid.Column="3"  Margin="6,4,4,4" x:Name="themeVariant"  FontSize="12" TextChanged="themeVariant_TextChanged" />

			<StackPanel Orientation="Horizontal" x:Name="RegistredPanel" Grid.Row="1" Grid.ColumnSpan="4" Visibility="Visible">
				<sdk:Label Content="Регистрационный номер:"  Grid.Column="0" Grid.Row="1"  Margin="3" FontSize="12" />
				<sdk:Label Grid.Column="1"  Grid.Row="1" Margin="3" Width="120" x:Name="regNumberText"   FontSize="12" Content=" " />

				<sdk:Label Content="Дата регистрации:" Grid.Column="2" Grid.Row="1"  Margin="3" FontSize="12" />
				<sdk:Label Grid.Column="3" Grid.Row="1"  Margin="3" x:Name="dateRegText"  FontSize="12" Width="120" Content=" " />
			</StackPanel>

			<StackPanel Orientation="Horizontal" x:Name="NotRegistredPanel" Grid.Row="1" Grid.ColumnSpan="4" Visibility="Collapsed">
				<sdk:Label Content="Тема не зарегестрирована!" FontSize="14" Foreground="Red"/>
            </StackPanel>

			<Button x:Name="saveTheme" Grid.Column="3" Margin="0,3,3,3" Grid.Row="1" Content="Сохранить" HorizontalAlignment="Right"  Click="Save2_Click"/>
        </Grid>
        <data:DataGrid IsReadOnly="true" Grid.Row="2" AutoGenerateColumns="False"  ItemsSource="{Binding}" Margin="10,30,10,10" x:Name="reqsWorkDTODataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" FontSize="12">
			<data:DataGrid.Columns>
				<data:DataGridTextColumn x:Name="nameReq" Binding="{Binding LR.RR.nameReq}" Header="Название документа" Width="Auto" />
				<data:DataGridTextColumn x:Name="Expdoc" Binding="{Binding LR.expdoc}" Header="Расширение документа" Width="Auto" />
				<data:DataGridTemplateColumn Header="Статус" IsReadOnly="True">
					<data:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<Image Width="20" Height="20" Source="{Binding StatusImageUrl}"   Stretch="Fill"/>
						</DataTemplate>
					</data:DataGridTemplateColumn.CellTemplate>
				</data:DataGridTemplateColumn>
				<data:DataGridTemplateColumn Width="80">
					<data:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
                            <Button x:Name="Save" Content="Загрузить" Foreground="DarkBlue" Width="75" Tag="1" Click="Save_Click" Visibility="{Binding Converter={StaticResource loadButtonVisibiliryConverter}}"/>
						</DataTemplate>
					</data:DataGridTemplateColumn.CellTemplate>
				</data:DataGridTemplateColumn>
				<data:DataGridTemplateColumn Width="80">
					<data:DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
                            <Button x:Name="Del" Content="Удалить" Foreground="DarkBlue" Width="75" Tag="2" Click="Del_Click" Visibility="{Binding Converter={StaticResource delButtonVisibiliryConverter}}" />
						</DataTemplate>
					</data:DataGridTemplateColumn.CellTemplate>
				</data:DataGridTemplateColumn>
				<data:DataGridTextColumn x:Name="DateLoad" Binding="{Binding LR.lWs.DateLoad, StringFormat=dd.MM.yyyy}" Header="Дата загрузки" Width="Auto" />
			</data:DataGrid.Columns>
		</data:DataGrid>
		<sdk:Label Grid.Row="2" HorizontalAlignment="Left" Margin="10" x:Name="label2" VerticalAlignment="Top" Content="Требования по работе:" FontSize="12" />
		<StackPanel Grid.Row="3" Orientation="Horizontal" Margin="3">
			<Button Visibility="Visible" Content="Назад"  Grid.Row="3" Margin="3"  x:Name="button3"  FontSize="12" Click="Back_Click" Width="71" />
			<Button Content="Зарегистрировать" Grid.Row="3" Margin="3" x:Name="button4"  FontSize="12" Click="button4_Click" Width="143" />
		</StackPanel>
		<Rectangle Grid.Row="2" Height="50" HorizontalAlignment="Center"  x:Name="rectangle1" Stroke="Black" StrokeThickness="1" VerticalAlignment="center" Width="300"  />
		<sdk:Label Grid.Row="2" Height="50" HorizontalAlignment="Center"  x:Name="label1" VerticalAlignment="center" Width="300" Content="Требования к работе не выставлены" />
		<Grid x:Name="LoadingGrid" Background="White" Opacity="0.9"  Visibility="collapsed" Canvas.ZIndex="100" Margin="0,23,0,0" Grid.RowSpan="4">
			<StackPanel Margin="5" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image Name="im" Height="30" Width="30" Margin="5" Source="/RegOnline;component/picts/clock.jpg"/>
                      
				<TextBlock Margin="5" TextWrapping="Wrap" Width="300" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center"  Text="Файл загружается. Пожалуйста, подождите..."/>
			</StackPanel>
		</Grid>
        <data:DataGrid AutoGenerateColumns="False" Visibility="Collapsed" ItemsSource="{Binding}" x:Name="worksDTODataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" FontSize="12" CanUserResizeColumns="False" CanUserSortColumns="False" RowHeight="30" MinColumnWidth="20" Margin="54,5,127,312" Grid.Row="2">
            <data:DataGrid.Columns>
                <data:DataGridTextColumn IsReadOnly="False" x:Name="themeColumn" Binding="{Binding theme}" Header="Тема работы" Width="Auto" />
                <data:DataGridTextColumn IsReadOnly="False" x:Name="optionsColumn" Binding="{Binding options}" Header="Вариант" Width="Auto" />
                <data:DataGridTemplateColumn Width="80">
                    <data:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button x:Name="Save2" Content="Сохранить" Foreground="DarkBlue" Width="75" FontSize="12" Click="Save2_Click" />
                        </DataTemplate>
                    </data:DataGridTemplateColumn.CellTemplate>
                </data:DataGridTemplateColumn>
                <data:DataGridTextColumn IsReadOnly="true" x:Name="regNumColumn" Binding="{Binding RegNum}" Header="Регистрационный №" Width="Auto" />
                <data:DataGridTextColumn IsReadOnly="true" x:Name="regDateColumn" Binding="{Binding RegDate}" Header="Дата регистрации" Width="Auto" />
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>

      

</navigation:Page>
